<?php
/**
 * download.php
 *
 * download the updated pcap files
 *
 *
 * LICENSE: 
 * This file is part of EasyShark.
 *
 *   EasyShark is free software: you can redistribute it and/or modify
 *   it under the terms of the GNU General Public License as published by
 *   the Free Software Foundation, either version 3 of the License, or
 *   (at your option) any later version.
 *
 *   EasyShark is distributed in the hope that it will be useful,
 *   but WITHOUT ANY WARRANTY; without even the implied warranty of
 *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 *   GNU General Public License for more details.
 *
 *   You should have received a copy of the GNU General Public License
 *   along with EasyShark.  If not, see <http://www.gnu.org/licenses/>.
 *
 * @author     Balazs Barcsik <balazs.barcsik@gmail.com>
 * @license    http://www.gnu.org/licenses/gpl.txt
 */

include 'config.php';

$file_full="";

if($_GET) {
	if(isset($_GET["file"])) {
		$file = $_GET["file"];
		$file_full = $root_folder.'/'.$_GET["file"];
	}
}

header('Pragma: public');
header('Expires: 0');
header('Cache-Control: must-revalidate, post-check=0, pre-check=0');
header('Cache-Control: private', false); // required for certain browsers
header('Content-Type: application/octet');

header('Content-Disposition: attachment; filename="'. basename($file_full) . '";');
header('Content-Transfer-Encoding: binary');
header('Content-Length: ' . filesize($file_full));

readfile($file_full);

exit;
?>